# set library name
set(TARGET_LIB png)
add_definitions(-DMODULE_NAME=\"${TARGET_LIB}\") # for core/io.h

# include common setting
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakelists_common.txt)

# path setting
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/../core/include)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test_bin)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)

# load external libraries
_load_libpng_library()

# build library
file(GLOB LIB_SRC src/*.cpp)
add_library(${TARGET_LIB} ${LIB_SRC})
target_link_libraries(${TARGET_LIB} ${PNG_LIBRARY} core)

# build test code
add_executable(storage_io test/test_storage_io.cpp)
target_link_libraries(storage_io ${TARGET_LIB})
